package com.mcms.web.vo;

import java.util.Map;

public class PageAction {

	private PagePara pagePara;
	private Integer pageNum;// 当前页码
	private Integer numPerPage;// 每页记录数
	private String orderField;// 查询排序字段
	private String orderDirection;// 升降序

	public String getOrderDirection() {
		return orderDirection;
	}

	public void setOrderDirection(String orderDirection) {
		this.orderDirection = orderDirection;
	}

	public void setPagePara(PagePara pagePara) {
		this.pagePara = pagePara;
	}

	public PagePara getPagePara() {
		if (pagePara == null)
			pagePara = new PagePara();
		return pagePara;
	}

	public Integer getPageNum() {
		return (pageNum == null || pageNum <= 0) ? 1 : pageNum;
	}

	public void setPageNum(Integer pageNum) {
		this.pageNum = pageNum;
		getPagePara().setPageIndex(getPageNum());
	}

	public Integer getNumPerPage() {
		return numPerPage == null ? 10 : numPerPage;
	}

	public void setNumPerPage(Integer numPerPage) {
		this.numPerPage = numPerPage;
		getPagePara().setPageSize(getNumPerPage());
	}

	public String getOrderField() {
		return orderField;
	}

	public void setOrderField(String orderField) {
		this.orderField = orderField;
	}
}
